package cn.neusoft.po;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonInclude;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.ToString;
import java.io.Serializable;
import java.util.Date;
import java.util.List;

/**
 * @author hxj
 * @since 2024-01-02
 */
@Data
@ToString
@AllArgsConstructor
@NoArgsConstructor
@TableName("t_order")
public class Order implements Serializable {

    private static final long serialVersionUID = 1L;

    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    /**
     * 摘要
     */
    private String digest;

    /**
     * 待支付0 已完成1
     */
    private Integer state;

    private Double sumprice;

    private String ordersn;

    private String payinfo;

    private String wuliuinfo;

    @JsonFormat(pattern = "yyyy-MM-dd",timezone = "GMT+8")
    private Date lastpaytime;

    @JsonFormat(pattern = "yyyy-MM-dd",timezone = "GMT+8")
    private Date lastconfirmtime;

    private Long userId;

    private Long addressId;

    @TableField(exist = false)
    @JsonInclude(JsonInclude.Include.NON_NULL)
    private User user;

    @TableField(exist = false)
    @JsonInclude(JsonInclude.Include.NON_NULL)
    private Address address;

    @TableField(exist = false)
    @JsonInclude(JsonInclude.Include.NON_EMPTY)
    private List<OrderDetail> orderDetails;
}
